package com.spark.incoicings.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.spark.invoicings.entity.PurchaseDetail;
import com.spark.invoicings.utils.Result;

import java.util.List;
import java.util.Map;

public interface PurchaseDetailService extends IService<PurchaseDetail> {

    /**
     * 获取所有状态为待入库的明细
     * @return
     */
    List<PurchaseDetail> selectPurchaseDetailStatusAll();

    /**
     * 根据id获取采购明细
     * @param id
     * @return
     */
    List<PurchaseDetail> selectDetailById(Integer id);

    /**
     * 根据id获取采购明细
     * @param id
     * @return
     */
    PurchaseDetail selectPurchaseDetailsById(Integer id);

    /**
     * 查询所有采购明细
     * 分页
     * 根据订单号模糊查询
     * @param map
     * @return
     */
    List<PurchaseDetail> selectPurchaseDetailAll(Map<String, Object> map);

    /**
     * 添加采购明细
     * @param purchaseDetail
     * @return
     */
    Result addPurchaseDetail(PurchaseDetail purchaseDetail);

    /**
     * 根据id更新采购明细
     * @param purchaseDetail
     * @return
     */
    boolean updatePurchaseDetailById(PurchaseDetail purchaseDetail);

}
